<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>会员中心</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <link rel="stylesheet" type="text/css" href="/css_z/center.css"/>
    <link rel="stylesheet" type="text/css" href="/css_z/loaders.min.css"/>
    <link rel="stylesheet" type="text/css" href="/css_z/loading.css"/>
    <script src="/js_z/rem.js"></script>
    <script src="/js_z/jquery.min.js" type="text/javascript"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <script type="text/javascript">
        sessionStorage.url = "confirm";
        $(window).load(function () {
            $(".loading").addClass("loader-chanage")
            $(".loading").fadeOut(300)
        })
        $(function () {
            //获取当前登录用户的(session)信息
            var user = JSON.parse(sessionStorage.getItem("user"));
           $('#pei').click(function () {
               $(document).dialog({
                   overlayClose: true,
                   titleShow: false,
                   autoClose: 1000,
                   content: '赔!',
               });
           });
            $.get('/signs/'+user.id+'/grade',function (data) {
                $('#jifen').html(data.grade)
                $('#myjifen').html(data.grade)
            });
           var user = JSON.parse(sessionStorage.getItem("user"))
            $('.myorder').click(function () {
                var href = $(this).data('href');
                href+= user.id
                window.location.href = href
            })
            $.ajax({
                async: false,
                url:'/users/countOrder',
                method:"get",
                success: function (data) {
                    console.log(data);
                    $.each(data,function (index,value) {
                        if(value.order_status==0 && value.count >0){
                            $('#daifukuanshu').html(value.count)
                        }else if(value.order_status==1 && value.count >0){
                            $('#daishouhuo').html(value.count)
                        }else if(value.order_status==2 && value.count >0){
                            $('#daipinjia').html(value.count)
                        }
                    })
                }

            })
        });
    </script>
</head>
<!--loading页开始-->
<div class="loading">
    <div class="loader">
        <div class="loader-inner pacman">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
</div>
<!--loading页结束-->
<body style="background-color: #f0f0f0">
<header id="header" style="">
    <div class="topbar">
        <a href="javascript:history.back();" class="back_btn"><i class="iconfont">ş</i></a>
        <h1 class="page_title">会员中心</h1>
    </div>
</header>
<!-- 会员头像 -->
    <div class="vip-header">
        <a href="javascript:">
            <dl>
                <dt>
                    <img src="/upload/e177ddc5-2cdc-4ec9-a56b-94408af7f7ab.png" id="pei"/>
                </dt>
                <dd>
                    <h4>hjl416148489<span>普通会员</span></h4>
                    <p><span>积分：<i id="myjifen">30</i></span>&nbsp;&nbsp;<span>红包：<i>0</i></span></p>
                </dd>
            </dl>
        </a>
        <ul>
            <li><a class="myorder" data-href="/mine/myorder.html?userId=" ><span id="daifukuanshu">0</span><p>待付款</p> </a></li>
            <li><a class="myorder" data-href="/mine/myorder.html?userId="><span id="daishouhuo">0</span><p>待收货</p> </a></li>
            <li><a class="myorder" data-href="/mine/myorder.html?userId="><span id="daipinjia">0</span><p>待评价</p> </a></li>
        </ul>
    </div>
<!-- 会员俱乐部 -->
    <div class="vip-club border_top_bottom">
        <div class="vip-club-title border_bottom">
            <span><i class="iconfont"></i>会员俱乐部</span>
            <a href="/mine/sgin.html">每日签到领积分<i class="iconfont"></i></a>
        </div>
        <ul>
            <li><a href=""><i class="iconfont"></i><p>我的订单</p> </a></li>
            <li><a href=""><i class="iconfont"></i><p>我的秒杀</p> </a></li>
            <li><a href=""><i class="iconfont" style="font-size: 28px;"></i><p>我的众筹</p> </a></li>
            <li><a href=""><i class="iconfont"></i><p>我的预约</p> </a></li>
        </ul>
    </div>
    <div class="vip-club border_top_bottom vip-account">
        <div class="vip-club-title border_bottom">
            <span><i class="iconfont"></i>我的账户</span>
            <a href="./index.html">积分兑换商品<i class="iconfont"></i></a>
        </div>
        <ul>
            <li><a href=""><i class="color_f44623">0</i><p>账户余额</p> </a></li>
            <li><a href=""><i class="color_f4a425" id="jifen" ></i><p>我的积分</p> </a></li>
            <li><a href=""><i class="color_45a1de">0</i><p>我的礼券</p> </a></li>
            <li><a href=""><i class="color_1dccaa">1</i><p>宝贝收藏</p> </a></li>
        </ul>
    </div>
    <div class="vip-list-icon border_top_bottom">
        <ul>
            <li class="border_bottom"> 
                <a href="" class="border_right"><i class="iconfont icon-sousuo"></i><em>维修查询</em></a>
                <a href=""><i class="iconfont" style="font-size:24px;"></i><em>报修退换</em></a> 
            </li>
            <li class="border_bottom">
                <a href="" class="border_right"><i class="iconfont" style="font-size:24px;"></i><em>物流查询</em></a> 
                <a href="./address.html" onclick="sessionStorage.url = 'center';"><i class="iconfont icon-dizhi1"></i><em>收货地址</em></a> 
            </li>
            <li class="border_bottom"> 
                <a href="" class="border_right"><i class="iconfont"></i><em>评价晒单</em></a>
                <a href=""><i class="iconfont" style="font-size:20px; text-indent:2px;"></i><em>我的投诉</em></a>
             </li>
            <li> 
                <a href="" class="border_right"><i class="iconfont"></i><em>我的咨询</em></a> 
                <a href=""><i class="iconfont" style="font-size:23px;"></i><em>二手订单</em></a>
            </li>
        </ul>
    </div>
    <!--尾部-->
    <footer class="page-footer fixed-footer" id="footer">
        <ul>
            <li>
                <a href="index.html">
                    <i class="iconfont icon-shouye"></i>
                    <p>首页</p>
                </a>
            </li>
            <li>
                <a href="cation.html">
                    <i class="iconfont icon-icon04"></i>
                    <p>分类</p>
                </a>
            </li>
            <li>
                <a href="shopcar.html">
                    <i class="iconfont icon-gouwuche"></i>
                    <p>购物车</p>
                </a>
            </li>
            <li class="active">
                <a href="center.html">
                    <i class="iconfont icon-yonghuming"></i>
                    <p>我的</p>
                </a>
            </li>
        </ul>
    </footer>

</body>

</html>
